home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / syscall / ds3100.md / userSysCallInt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-06  |  1.4 KB  |  50 lines

  1. /*
  2.  * userSysCallInt.h --
  3.  *
  4.  *     Contains macro for stubs for user-level system calls.
  5.  *
  6.  * Copyright 1985, 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * rcs = $Header: /sprite/src/lib/c/syscall/ds3100.md/RCS/userSysCallInt.h,v 1.2 89/07/26 18:24:50 nelson Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #include "kernel/sysSysCall.h"
  19. #include "kernel/ds3100.md/machConst.h"
  20. #include <regdef.h>
  21.  
  22. #ifndef _USERSYSCALLINT
  23. #define _USERSYSCALLINT
  24.  
  25. /*
  26.  * Magic number to put into t1 so we know that this is a Sprite system 
  27.  * call and not a UNIX one.
  28.  */
  29. #define    SYS_MAGIC    0xbab1fade
  30.  
  31. /*
  32.  * ----------------------------------------------------------------------------
  33.  *
  34.  * SYS_CALL --
  35.  *
  36.  *      Define a user-level system call.  The call sets up a trap into a 
  37.  *    system-level routine with the appropriate constant passed as
  38.  *     an argument to specify the type of system call.
  39.  * ----------------------------------------------------------------------------
  40.  */
  41.  
  42. #define SYS_CALL(name, constant) \
  43.     .globl name; name: \
  44.     li t0, constant; \
  45.     li t1, SYS_MAGIC; \
  46.     syscall; \
  47.     j ra
  48.  
  49. #endif _USERSYSCALLINT
  50.